package cn.bdqn.easyexcel_web.utils;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.bdqn.easyexcel_web.service.UserService;

@Component
public class UserServiceUtil {
	@Autowired
	private UserService userService;
	@PostConstruct
    public void init(){
		UserServiceUtil.getInstance().userService = this.userService;
    }
	 /**
     *  实现单例 start
     */
    private static class SingletonHolder {
        private static final UserServiceUtil INSTANCE = new UserServiceUtil();
    }
    private UserServiceUtil (){}
    public static final UserServiceUtil getInstance() {
        return SingletonHolder.INSTANCE;
    }
    /**
     *  实现单例 end
     */
    public UserService getUserService(){
        return UserServiceUtil.getInstance().userService;
    }
}
